package com.mf.exception;

import com.mf.emuns.basic.EnumResultCode;

/**
 * @Author: lmf
 * @Create: 2025/3/8 20:46
 * Description:  封装自定义异常使用
 */

public class GraceException {
    public static void display(EnumResultCode enumResultCode) {
        throw new ApiException(enumResultCode);
    }

    public static void display(String message) {
        throw new ApiException(message);
    }

    /**
     * 如果条件为真那么抛出异常
     */
    public static void display(Boolean condition, String message) {
        if (condition) {
            throw new ApiException(message);
        }
    }
}
